package cn.aloxc.tianya.reader;

import cn.aloxc.tianya.reader.R;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;

public class BroadcastReceiverCreate extends android.content.BroadcastReceiver {
	Context context;
	public static int NOTIFICATION_ID = 21321;

	@Override
	public void onReceive(Context context, Intent intent) {
		this.context = context;
		showNotification();

	}

	private void showNotification() {
		NotificationManager manage = (NotificationManager) context
				.getSystemService(android.content.Context.NOTIFICATION_SERVICE);
		Notification notification = new Notification(R.drawable.msn,
				"测试notification", System.currentTimeMillis());
		PendingIntent intent = PendingIntent.getActivity(context, 0, new Intent(context,Activity_test_broadAintent.class), 0);
		notification.setLatestEventInfo(context, "这是什么title哦", null, intent);
		manage.notify(NOTIFICATION_ID, notification);
	}
}
